package com.liaoxuefeng.java_thread.java01;

import java.math.BigInteger;

public class RecordTest {

    public static void main(String[] args) {
//        PointTest p = new PointTest(123, 456);
//        System.out.println(p.x());
//        System.out.println(p.y());

        // 当使用的整数范围超过了 long 类型的
        BigInteger b1 = new BigInteger("1234567890");
        BigInteger b2 = new BigInteger("12345678901234567890");
        System.out.println(b1.pow(5));
        BigInteger sum = b1.add(b2);
        System.out.println(sum);

        // 生成随机数 [min, max]
        double x = Math.random(); // x 的范围是 [0, 1)
        double min = 10;
        double max = 50;
        double y = x * (50 - min) + min; // y = [10, 50)
        long n = (long) y;
        System.out.println(y);
        System.out.println(n);
    }
}

//record PointTest(int x, int y) {}
